import Vue from 'vue'
import VueRouter from 'vue-router'
import Home from '@views/Home'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    redirect: '/home'
  },
  {
    path: '/home',
    name: 'Home',
    component: Home
  },
  {
    path: '/cate',
    name: 'cate',
    component: () => import('@views/Cate')
  },
  {
    path: '/cart',
    name: 'cart',
    component: () => import('@views/Cart')
  },
  {
    path: '/user',
    name: 'user',
    component: () => import('@views/User')
  },
  {
    path: '/itemLists',
    name: 'itemLists',
    component: () => import('@views/ItemLists')
  },
  {
    path: '/detail/:itemId',
    name: 'detail',
    component: () => import('@views/Detail')
  },
  {
    path: '/currentOrder',
    name: 'currentOrder',
    component: () => import('@views/CurrentOrder')
  },
  {
    path: '/contactAdd',
    name: 'contactAdd',
    component: () => import('@views/ContactAdd')
  },
  {
    path: '/contactList',
    name: 'contactList',
    component: () => import('@views/ContactList')
  },
  {
    path: '/contactEdit',
    name: 'contactEdit',
    component: () => import('@views/ContactEdit')
  }
]

const router = new VueRouter({
  routes
})

export default router
